<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
    <script>
        // let age = 19
        // const obj ={
        //     name : 'li',
        //     age:20,
        //     address: {area:'contury'},
        // }
        // let{age,address:{area}} =obj
        // console.log(age)

        // //数组的解构赋值
        // let arr = [1,3]
        // let[a,b] =arr
        // console.log(a)
        // console.log(b)

        // //省略前几个数组元素
        // let stu = ['zhangsan', 'lisi','wanglaowu']
        // let[,,ww] = stu
        // let[yy,,xixi] =stu
        // console.log(ww)
        // console.log(yy)
        // console.log(xixi)
        //换值
        let a = 1;
        let b = 2;
        [a,b]=[b,a]
        console.log(a)
        console.log(b)
    </script>
</body>
</html>